package com.briup.dao;

import com.briup.bean.Teacher;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

@Repository
public class TeacherDAOImpl implements ITeacherDAO{
    @Override
    public Teacher findTeacherById(Integer id) throws Exception{
        //jdbc代码 连接数据库 查询
        //Class.forName("a.b.c");
        if(id == 4){
            throw new SQLException("sql 格式错误");
        }
        return new Teacher(2,"tom");
    }
}
